//
//  LogMgr.swift
//  YS
//
//  Created by 元穗 on 2017/5/22.
//  Copyright © 2017年 yuansui. All rights reserved.
//

import Foundation

/// 全局Log打印
/// 不可嵌套调用

open class Log {
    public class func d(_ text: String,
                        file: String = #file,
                        method: String = #function,
                        line: Int = #line) {
//        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(text)");
    }

    public class func d(_ text: Int,
                        file: String = #file,
                        method: String = #function,
                        line: Int = #line) {
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(String(text))");
    }

    /// 打印变量在内存中的地址
    ///
    /// - Parameter o:
    public class func address(_ o: AnyObject,
                              file: String = #file,
                              method: String = #function,
                              line: Int = #line) {
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(Unmanaged.passUnretained(o).toOpaque())");
    }
}


